<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script>
</head>
<body>
    用户名：<input type="text" id="username">
    密码：<input type="password" id="password">
    <button id="btn">提交</button>
    
    <script>
        document.getElementById("btn").onclick = function(){
            $.ajax({
                url:"http://localhost:3000/findUser",
                type:"post",
                data:{
                    username:document.getElementById("username").value,
                    password:document.getElementById("password").value,
                    time:Date.now(),
                    sex:"男"
                },
                success:function(data){
                    console.log("成功请求的回调：",data);
                },
                error:function(err){
                    console.log(err);
                }
            })
        }
    </script>
</body>
</html>